package com.xgh.design.factory;

/**
 * @ClassName ShapeFactory
 * @Description
 * @Author xinggh
 * @Date 2020/8/6 21:42
 * @Version 1.0
 **/
public class ShapeFactory {

    public Shape getShape(String type) {
        if (type == null) {
            return null;
        } else if (type.equals("Square")) {
            return new Square();
        } else if (type.equals("Rectangle")) {
            return new Rectangle();
        }
        return null;
    }
}
